<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title>懒狗</title>
		<link rel="stylesheet" href="__OEM__/css/iconfont.css" />
		<link rel="stylesheet" href="__OEM__/css/css.css" />
	</head>
	<body>
		<div class="navbox clearfix">
			<div class="logo"><img src="__OEM__/img/agentlogo.png"></div>
			<ul class="lognav">
				<li><a href="{:url('login/login')}">首页</a></li>
				<li><a href="#" onclick="about()">关于我们</a></li>
			</ul>
		</div>
		<div class="content">
			<div class="contbox clearfix">
				<div class="left">
					<p class="bt">懒狗 </p>
					<p class="tip">微信客户端&nbsp;&nbsp;&nbsp;&nbsp;管理更方便</p>
					<div class="erweimabox clearfix">
						<div class="ios">
							<p><img src="__OEM__/img/erweima.jpg"></p>
							<p class="wz">微信扫一扫关注</p>
						</div>
						<div class="android">
							<p><img src="__OEM__/img/erweima.jpg"></p>
							<p class="wz">微信扫一扫关注</p>
						</div>
					</div>
				</div>
				<div class="right">
					<div class="login_form">
						<div class="top">
							<a  class="active" href="{:url('agent/login/login')}">商户登录</a>
						</div>
						<form  action="" method="post">
							<div class="number"><input type="text" name="mobile" id='mobile' value="" placeholder="手机号"></div>
							<div class="password"><input type="password" name="password" id='password' value="" placeholder="请输入密码"></div>
							<div class="button"><input type="button" id='btn' value="登录"></div>
							<div class="forget"><a href="#" onclick="forget()">忘记密码</a></div>
						</form>
					</div>
				</div>
			</div>
		</div>
		
		<div class="login_bottom">
			<p>Copyright© 2018 懒狗.All Rights Reserved</p>
			<p>湖南懒狗网络科技有限公司 版权所有 湘ICP备18012526号</p>
		</div>
	</body>
</html>
<script src="__PUBLIC__/static/js/jquery.min.js"></script>
<script src="__PUBLIC__/static/layui/layui.all.js"></script>
<script src="__PUBLIC__/static/js/mui.min.js"></script>
<script>
	$('#btn').click(function() {
		var mobile = $("#mobile").val();
		var password = $("#password").val();
		if(mobile == '') {
			layer.msg('用户名不能为空');
			return;
		}

		if(password.trim() == '') {
			layer.msg('密码不能为空');
			return;
		}

		$.ajax({
			url: "{:url('login/login')}",
			type: 'post',
			data: {
				mobile: mobile,
				password: password
			},
			success: function(data) {
				if(data.code == 200) {
					layer.msg(data.msg, {
						icon: 1,
						time: 1000
					}, function() {
						location.reload();
					});
				} else {
					layer.msg(data.msg, {
						icon: 1,
						time: 1000
					});
				}
			}
		})
	});

	function forget() {
		layer.open({
			type: 2,
			title: '修改密码',
			shadeClose: true,
			shade: 0.8,
			area: ['350px', '300px'],
			content: "{:url('login/forget')}"
		});
	}
	function about() {
		layer.open({
			type: 2,
			title: '关于我们',
			shadeClose: true,
			shade: 0.8,
			area: ['70%', '90%'],
			content: "{:url('login/about')}"
		});
	}
</script>